//
//  PostTagCellData.m
//  CKApp
//
//  Created by CC on 2020/9/12.
//  Copyright © 2020 This Moment. All rights reserved.
//

#import "PostTagCellData.h"
#import "PostTagCell.h"

@implementation PostTagCellData

+ (instancetype)cellDataWithImage:(NSString*)iconName
           title:(NSString*)title
         content:(NSString*)content
onCellClickedHandler:(OnCellClickedHanlder)onCellClickedHandler {
  PostTagCellData* cellData = [[PostTagCellData alloc] init];
  cellData.iconName = iconName;
  cellData.title = title;
  cellData.content = content;
  cellData.onCellClickedHandler = onCellClickedHandler;
  cellData.clickable = YES;
  return cellData;
}

- (void)refreshCell:(__kindof PostTagCell *)cell {
  [super refreshCell:cell];
  cell.iconImageView.image = [UIImage imageNamed:self.iconName];
  cell.titleLabel.text = self.title;
  cell.contentLabel.text = self.content;
}

@end
